#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int hf[50][50] = { 0 };
int k, i, j, n, dx, dy;
int main()
{
    cin >> n;
    k = 1;
    dx = 1;dy = n / 2 + 1;
    hf[dx][dy] = k;
    for (k = 2;k <= n * n;k++)
    {
        if (dx == 1 & dy != n)
        {
            dx = n;dy++;
        }
        else if (dx != 1 && dy == n)
        {
            dy = 1;dx--;
        }
        else if (dx == 1 && dy == n) dx++;
        else if (dx != 1 && dy != n)
        {
            if (hf[dx - 1][dy + 1] == 0 && (dx - 1 > 0 && dy + 1 <= n))
            {
                dx--;
                dy++;
            }
            else dx++;
        }
        hf[dx][dy] = k;
    }
    for (i = 1;i <= n;i++)
    {
        for (j = 1;j <= n;j++)cout << hf[i][j] << ' ';
        cout << endl;
    }
    return 0;
}